package com.controller;

import com.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {
    @Autowired
    private IndexService indexService;

    @RequestMapping("/index")
    public String index(Model model){
        model.addAttribute("filmListTop4",indexService.selectTop());
        model.addAttribute("filmListSoon",indexService.selectSoon());
        return "index";
    }
}
